package com.five.wisdomClass.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.five.wisdomClass.entity.Course;
import com.five.wisdomClass.entity.Teacher;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TeacherMapper  extends BaseMapper<Teacher> {

    // 通过教师编号获取公共课程
    @Select("SELECT course,start_time,end_time,location FROM smartcampus.public_course WHERE teacher_number = #{teacherNumber}")
    List<Course> getPublicCourse(@Param("teacherNumber") String teacherNumber);

    // 通过教师编号获取选修课程
    @Select("SELECT course,start_time,end_time,location FROM smartcampus.take_course WHERE teacher_number = #{teacherNumber}")
    List<Course> getTakeCourse(@Param("teacherNumber") String teacherNumber);


}
